<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025-09-18
  Time: 11:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
    <link href="css/base.css" rel="stylesheet">
    <link href="css/form.css" rel="stylesheet">
</head>
<body>
    <form name="formLogin">
        <h2 id="Title">登录</h2>

        <div class="inputDiv">
            <label>用户名: <input type="text" name="userName"></label>
        </div>

        <div class="inputDiv">
            <label>密&nbsp;&nbsp;&nbsp;&nbsp;码: <input type="text" name="password"></label>
        </div>

        <div class="inputDiv" id="inputBot">
            <input id="firstButton" class="button" type="submit" value="登录">
            <input id="secondButton" class="button" type="reset" value="重置">
        </div>
    </form>
    <script>
        document.getElementsByName("formLogin")[0].onsubmit = function() {
            if (document.formLogin.userName.value == '') {
                alert("请输入用户名");
                return false;
            } else if (document.formLogin.password.value == '') {
                alert("请输入密码");
                return false;
            }
            window.location.href = "listFoodType.jsp";
            return false;
        }
    </script>
</body>
</html>
